whereis apt && sudo apt install libssl-dev cmake -y
whereis yum && yum install openssl-devel
set -e

git clone --recursive https://github.com/saghul/txiki.js --shallow-submodules
cd txiki.js
make
cp build/tjs /usr/local/bin


git clone https://github.com/bellard/quickjs.git
wget https://raw.githubusercontent.com/ftk/quickjspp/master/quickjs/patches/getclassid.patch
cd quickjs
patch < ../getclassid.patch
make qjs libquickjs.a qjsc
mkdir -p /usr/local/qjs
cp libquickjs.a /usr/local/qjs
cp qjs /usr/local/bin
cd ..
cp quickjs/quickjs.h /usr/local/qjs
cp quickjs/quickjs-libc.h /usr/local/qjs